import React, { Component } from 'react';
import loadingIMG from '../../assets/timg.gif'
import ReactDOM from 'react-dom'
import './style.scss'
class Loading extends Component {
    constructor(){
        super();
        this.el = document.createElement('div');
        this.el.className = 'modal';
    }
    render() {
        return ReactDOM.createPortal(
          <div className="loading-panel">
            <img src={loadingIMG} alt=""/>
          </div>,
          this.el
        )
      }
    
      componentDidMount(){
        document.querySelector('body').appendChild(this.el);
      }
      componentWillUnmount(){
        document.querySelector('body').removeChild(this.el);
      }
    }

export default Loading;